<template>
  <detail-page title="编辑我的工作小结" @close="close">
    <abstract-form>
      <el-card>
        <WangEditor v-model="form.content" :height="300" />
      </el-card>
    </abstract-form>
  </detail-page>
</template>

<script>
import DetailPage from '@/views/_common/DetailPage'
import AbstractForm from '@/components/abstract/Form'
import WangEditor from '@/components/WangEditor'
import { closeCurrentPage } from '@/utils/route'

export default {
  name: 'EditWorkReport',

  components: {
    DetailPage,
    WangEditor,
    AbstractForm
  },

  data: () => ({ form: { content: null } }),

  methods: {
    //获取列表页的地址
    getTablePageUrl() {
      const url = this.$route.path
      const i = url.indexOf('/editReport')
      const tablePageUrl = url.substring(0, i)
      return [...tablePageUrl].join('')
    },

    //关闭页面并跳转到列表页
    close() {
      return closeCurrentPage(this.getTablePageUrl())
    }
  }
}
</script>
